package com.ruoyi.miaomiao.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.miaomiao.mapper.AdvertismentPictureMapper;
import com.ruoyi.miaomiao.domain.AdvertismentPicture;
import com.ruoyi.miaomiao.service.IAdvertismentPictureService;

/**
 * 宣传图Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-10
 */
@Service
public class AdvertismentPictureServiceImpl implements IAdvertismentPictureService 
{
    @Autowired
    private AdvertismentPictureMapper advertismentPictureMapper;

    /**
     * 查询宣传图
     * 
     * @param advertismentPictureId 宣传图主键
     * @return 宣传图
     */
    @Override
    public AdvertismentPicture selectAdvertismentPictureByAdvertismentPictureId(Long advertismentPictureId)
    {
        return advertismentPictureMapper.selectAdvertismentPictureByAdvertismentPictureId(advertismentPictureId);
    }

    /**
     * 查询宣传图列表
     * 
     * @param advertismentPicture 宣传图
     * @return 宣传图
     */
    @Override
    public List<AdvertismentPicture> selectAdvertismentPictureList(AdvertismentPicture advertismentPicture)
    {
        return advertismentPictureMapper.selectAdvertismentPictureList(advertismentPicture);
    }

    /**
     * 新增宣传图
     * 
     * @param advertismentPicture 宣传图
     * @return 结果
     */
    @Override
    public int insertAdvertismentPicture(AdvertismentPicture advertismentPicture)
    {
        advertismentPicture.setCreateTime(DateUtils.getNowDate());
        return advertismentPictureMapper.insertAdvertismentPicture(advertismentPicture);
    }

    /**
     * 修改宣传图
     * 
     * @param advertismentPicture 宣传图
     * @return 结果
     */
    @Override
    public int updateAdvertismentPicture(AdvertismentPicture advertismentPicture)
    {
        advertismentPicture.setUpdateTime(DateUtils.getNowDate());
        return advertismentPictureMapper.updateAdvertismentPicture(advertismentPicture);
    }

    /**
     * 批量删除宣传图
     * 
     * @param advertismentPictureIds 需要删除的宣传图主键
     * @return 结果
     */
    @Override
    public int deleteAdvertismentPictureByAdvertismentPictureIds(Long[] advertismentPictureIds)
    {
        return advertismentPictureMapper.deleteAdvertismentPictureByAdvertismentPictureIds(advertismentPictureIds);
    }

    /**
     * 删除宣传图信息
     * 
     * @param advertismentPictureId 宣传图主键
     * @return 结果
     */
    @Override
    public int deleteAdvertismentPictureByAdvertismentPictureId(Long advertismentPictureId)
    {
        return advertismentPictureMapper.deleteAdvertismentPictureByAdvertismentPictureId(advertismentPictureId);
    }
}
